package com.holly.unit.bpmn.modular.activiti.adapter;

import com.holly.unit.bpmn.activiti.pojo.ComboModel;
import com.holly.unit.system.api.pojo.user.SysUserDTO;

import java.util.ArrayList;
import java.util.List;

/**
 * 类描述: 适配器类 把SysUser转化成ComboModel 提供给Activiti使用
 *
 * @author fxr
 * @version 1.0.0
 * @date 2022/3/7 16:00
 */
public class SysUserToComboModel {

    public static List<ComboModel> convert(List<SysUserDTO> users) {
        List<ComboModel> list = new ArrayList<ComboModel>();
        for (SysUserDTO user : users) {
            ComboModel model = new ComboModel();
            model.setTitle(user.getRealName());
            model.setId(user.getUserId()+"");
            model.setUsername(user.getAccount());
            list.add(model);
        }
        return list;
    }

}
